package com.gaocf.designpatterns.create.singleton;

/**
 * 单例三种实现方式  饿汉 懒汉式  静态内部类
 */
public class Main {

    public static void main(String[] args) throws Exception {
        Singletion1 s11 = Singletion1.getInstance();
        Singletion1 s12 = Singletion1.getInstance();
        System.out.println(s11);
        System.out.println(s12);

        Singletion2 s21 = Singletion2.getInstance();
        Singletion2 s22 = Singletion2.getInstance();
        System.out.println(s21);
        System.out.println(s22);

        Singletion3 s31 = Singletion3.getInstance();
        Singletion3 s32 = Singletion3.getInstance();
        System.out.println(s31);
        System.out.println(s32);
    }
}
